//------------------------------------------------------------------------------
// Copyright (c) 2008 www.dnaide.com
// Licensed under the MIT (MIT-LICENSE.txt)
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;

namespace DNAide.Collections
{
	/// <summary>
	/// Queue helper methods
	/// </summary>
	public static partial class QueueAide
	{
		/// <summary>
		/// Returns a string Queue from a comma separated string.
		/// Trims spaces, does not allow duplicates and ignores empty entities
		/// </summary>
		/// <param name="value">value</param>
		/// <returns>Queue&lt;String&gt;</returns>
		public static Queue<String> GetFromString(String value)
		{
			return GetFromString(value, new char[] { ',' }, true, false, StringSplitOptions.RemoveEmptyEntries);
		}


		/// <summary>
		/// Returns a string Queue from a comma separated string.
		/// Trims spaces, does not allow duplicates and ignores empty entities
		/// </summary>
		/// <param name="value">value</param>
		/// <param name="delimeter">delimeter</param>
		/// <returns>Queue&lt;String&gt;</returns>
		public static Queue<String> GetFromString(String value, Char[] delimeter)
		{
			return GetFromString(value, delimeter, true, false, StringSplitOptions.RemoveEmptyEntries);
		}


		/// <summary>
		/// Returns a string Queue from a delimetered string.
		/// Does not allow duplicates and ignores empty entities
		/// </summary>
		/// <param name="value">value</param>
		/// <param name="delimeter">delimeter</param>
		/// <param name="trimSpaces">trimSpaces</param>
		/// <returns>Queue&lt;String&gt;</returns>
		public static Queue<String> GetFromString(String value, Char[] delimeter, Boolean trimSpaces)
		{
			return GetFromString(value, delimeter, trimSpaces, false, StringSplitOptions.RemoveEmptyEntries);
		}


		/// <summary>
		/// Returns a string Queue from a delimetered string.
		/// Ignores empty entities
		/// </summary>
		/// <param name="value">value</param>
		/// <param name="delimeter">delimeter</param>
		/// <param name="trimSpaces">trimSpaces</param>
		/// <param name="allowDuplicates">allowDuplicates</param>
		/// <returns>Queue&lt;String&gt;</returns>
		public static Queue<String> GetFromString(String value, Char[] delimeter, Boolean trimSpaces, Boolean allowDuplicates)
		{
			return GetFromString(value, delimeter, trimSpaces, allowDuplicates, StringSplitOptions.RemoveEmptyEntries);
		}


		/// <summary>
		/// Returns a string Queue from a delimetered string.
		/// </summary>
		/// <param name="value">value</param>
		/// <param name="delimeter">delimeter</param>
		/// <param name="trimSpaces">trimSpaces</param>
		/// <param name="allowDuplicates">allowDuplicates</param>
		/// <param name="splitOptions">splitOptions</param>
		/// <returns>Queue&lt;String&gt;</returns>
		public static Queue<String> GetFromString(String value, Char[] delimeter, Boolean trimSpaces, Boolean allowDuplicates, StringSplitOptions splitOptions)
		{
			return GetQueueAs<String>(value, delimeter, trimSpaces, allowDuplicates, splitOptions);
		}
	}
}
